﻿using DevTeam;
using System.Data;

namespace ConfExpert.Forms.Rapor
{
    public partial class AksesuarSayimBarkod : DevExpress.XtraReports.UI.XtraReport
    {
        //DataSet ds;
        int EmptyLabelCount;
        public bool Stop = false;
        

        public AksesuarSayimBarkod()
           
        {
            InitializeComponent();

            DataTable dt = new DataTable("tbl");
            dt.Columns.Add("barkodNo");

            DataSet ds = new DataSet();
            ds.Tables.Add(dt);

            for (int i = 8200; i < 9200; i++)
            {
                dt.Rows.Add(i);
                if ((i+1)%80==0)
                {
                    for (int j = 0; j < 10; j++)
                    {
                        dt.Rows.Add(0);
                    }
                }
            }
            this.DataMember = "tbl";
            this.DataSource = ds;
            
            xrBarCode1.DataBindings.Add("Text", null, "tbl.barkodNo");
        }       
        
        private void Detail_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            EmptyLabelCount--;
        }
        
        private void xrBarCode1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            int barkodNo = GetCurrentColumnValue("barkodNo").ToInt();
            if (barkodNo==0)
            {
                e.Cancel = true;
            }
        }
    }
}
